package com.mixsmart.web.msgpush.impl;

import com.mixsmart.web.msgpush.ISendMessage;

/**
 * 发送消息工厂
 * @author lmq
 * @version 1.0
 * @since JDK版本大于等于1.6
 * <p>2016年3月29日</p>
 */
public class SendMsgFactory {

	private ISendMessage sendMsg;
	
	private static SendMsgFactory instance = new SendMsgFactory();
	
	private SendMsgFactory() {
		//避免通过反映射创建对象实例
		//throw new RuntimeException("不能创建SendMsgFactory对象实例");
	}

	public static SendMsgFactory getInstatnce() {
		return instance;
	}
	
	public ISendMessage getSendMessage() {
		if(null == sendMsg) {
			sendMsg = new Comet4jSendMessage();
		}
		return sendMsg;
	}

	public void setSendMsg(ISendMessage sendMsg) {
		this.sendMsg = sendMsg;
	}
}
